package com.cskaoyan._05oop2._01inherit;

/**
 * @author Macro_Ray
 * @since 2024/3/8 15:09
 */
/* 定义一个银行账户类Account，3个属性，用户名，密码，余额.
 * 要求户名长度4-6位，密码长度6位。余额不能修改*/
public class _04Demo {
}

class Account{
    private String name;
    private int password;
    private int balance;


    public Account() {
    }

    public Account(String name, int password, int balance) {
        this.name = name;
        this.password = password;
        this.balance = balance;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return password
     */
    public int getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(int password) {
        this.password = password;
    }

    /**
     * 获取
     * @return balance
     */
    public int getBalance() {
        return balance;
    }

    /**
     * 设置
     * @param balance
     */
    public void setBalance(int balance) {
        this.balance = balance;
    }

    public String toString() {
        return "Account{name = " + name + ", password = " + password + ", balance = " + balance + "}";
    }
}
